<?php include '../public/header.php' ?>
<link rel='stylesheet' href='/static/admin/css/engincha.css'>
<style>

</style>
<body class="bodychu">
<div>
    <div class="layui-form seaxia seaonechu">
        <div class="titss layui-hide">搜索列表</div>
        <div class="mm">
            <div class="seadiv" style="width: 135px">
                <select id="seatype">
                    <option value="name">项目名称</option>
                    <option value="lian_unit">联营方/委托方</option>
                    <option value="man_xiang_name">项目负责人</option>
                </select>
            </div>
        </div>
        <div class="mm">
            <input type="text" id="seavalue" placeholder="请输入" clearable autocomplete="off" class="layui-input" onkeydown="subtijiao(this.value)" style="width: 400px">
        </div>
        <div class="mm">
            <button class="laytp-btn laytp-btn-primary" id="seabut" type="button"><i class="layui-icon layui-icon-search"></i> 查询</button>
        </div>
        <div class="clear"></div>
    </div>
    <div class="seacon layui-hide"></div>
</div>


<script>
    render_from()
    layui.use(['laytp', 'form'], function() {
        var form = layui.form, layer = layui.layer;

        $("#seabut").click(function () {
            $(".seaxia").removeClass('seaonechu');
            $(".titss").removeClass('layui-hide');
            $(".seacon").removeClass('layui-hide');

            var seatype = $("#seatype").val();
            var seavalue = $("#seavalue").val();
            if(!seavalue){
                layer.tips('请输入查询内容','#seavalue', {time: 2000, tips: [1, "#000"],});return false;
            }


            facade.ajax({url: ask_engin_cha_list, data:{seatype:seatype,seavalue:seavalue}}).done(function(res){
                if (res.code === 2000) {
                    var list = res.data;


                    var str = '';
                    if(list.length > 0){
                        for (var key in list) {
                            str += '<div class="kk" onclick="get_page_engin('+list[key].id+','+list[key].business+')">';

                            str += '<div class="hang">';
                            str += '<span class="name">'+list[key].name+'</span>';
                            str += '<span class="number">'+list[key].number+'</span>';
                            if(list[key].status == 0){
                                str += '<span class="status fbstatus0">审批中</span>';
                            }
                            if(list[key].status == 1){
                                str += '<span class="status fbstatus1">审批通过</span>';
                            }
                            str += '</div>';

                            str += '<div class="hang">';
                            if(list[key].business_name){str += '<span class="titzhan">'+list[key].business_name+'</span>';}
                            if(list[key].state_name){str += '<span class="titzhan">'+list[key].state_name+'</span>';}
                            if(list[key].engintype_name){str += '<span class="titzhan">'+list[key].engintype_name+'</span>';}
                            if(list[key].jian_unit){str += '<span class="titzhan">'+list[key].jian_unit+'</span>';}
                            if(list[key].areas){str += '<span class="titzhan">'+list[key].areas+'</span>';}
                            str += '</div>';

                            str += '<div class="hang hang_te">';
                            str += '<span>中标金额：'+list[key].winfee+'元</span>';
                            str += '<span>中标日期：'+list[key].windt+'</span>';
                            if(list[key].business == 2 && list[key].lian_unit){
                                str += '<span>联营方/委托方： '+list[key].lian_unit+'</span>';
                            }
                            str += '<span>项目负责人： '+list[key].man_xiang_name+'</span>';
                            str += '<span>实际开工日期：'+list[key].shikaidt+'</span>';
                            str += '<span>实际竣工日期：'+list[key].shijundt+'</span>';
                            str += '</div>';

                            str += '</div>';
                            str += '<div class="xian"></div>';
                        }
                    }else{
                        str += '<div class="noshuju">未查询到相关数据</div>';
                    }
                    $(".seacon").html(str);
                }
            });

        });



    });



    function get_page_engin(id, business) {
        if(business == 1){
            openNavPage('项目看板','engin_cha/dan.php?pagezhan=zi_fen&enginid='+id)
        }else{
            openNavPage('项目看板','engin_cha/dan.php?pagezhan=lian_fen&enginid='+id)
        }
    }








    function subtijiao() {
        if (event.keyCode == 13) {
            $("#seabut").click();
        }
    }
</script>
</body>
</html>
